/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package probability;
import java.util.*;
import net.*;
import structure.*;

/**
 *
 * @author antonio
 */
public class MergeInfoPointPosition {

    private String pointCandidate;
    private AccessPoint apSniffed;

    private TotalInfoPointPosition totalForOnePoint;

    public MergeInfoPointPosition(String pointCandidate, AccessPoint apSniffed, TotalInfoPointPosition totalForOnePoint)
    {
        
        this.apSniffed = apSniffed;
        this.pointCandidate = pointCandidate;
        this.totalForOnePoint = totalForOnePoint;

    }

    public TotalInfoPointPosition calculation()
    {
        String macSniffed = this.apSniffed.getMac();
        Vector signalSniffed = this.apSniffed.getSignal();
        String totalSniffed = this.apSniffed.getTotalSignal();

        Integer total = new Integer(totalSniffed);
        this.totalForOnePoint.updateTotal(total);

        for(int i=0; i<signalSniffed.size(); i++)
        {
            String stringFreq = (String)signalSniffed.elementAt(i);
            Integer freqSignal = new Integer(stringFreq);

            this.totalForOnePoint.updateSignal(i, freqSignal);
               
        }


        return this.totalForOnePoint;
    }



}
